import { getEditor } from "./test.ts";
Deno.test("test tr", async () => {
  const editor = getEditor();
  const tr = editor.tr;
  //开启事务 成功并提交
  await tr.asyncTransaction((doc) => {
    doc.attrs.value += 1;
    tr.setNodeAttribute("1", { name: "我是测试", email: "alice@example.com" });
  });
  editor.dispatch(tr);
  //开启事务 成功并提交
  const tr1 = editor.tr;
  await tr1.asyncTransaction((_doc) => {
    tr1.setNodeAttribute("1", {
      name: "我是测试aaaaaaa",
      email: "alice@example.com",
    });
  });
  editor.dispatch(tr1);
});
